export const now = new Date();
export const nowYear = (now.getFullYear()).toString();
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  dialogWidth: '70%',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  viewBtn: false,
  arrow: false,
  selection: 'true',
  selectable: row => {
    return row.checkStatus == '0' || row.checkStatus == '3'
  },
  column: [{
    label: '标识',
    prop: 'id',
    hide: true,
    addDisplay: false,
    editDisplay: false
  }, {
    label: '工作类型',
    prop: 'planType',
    type: 'select',
    dicUrl: '/admin/dict/type/plan_type',
    search: true,
    rules: [{
      required: true,
      message: '请选择计划类型',
      trigger: 'blur'
    }]
  }, {
    label: '票种',
    prop: 'ticketType',
    type: 'select',
    dicUrl: '/support/swpmticketcardtype/dict',
    props: {
      label: 'mainName',
      value: 'mainEnName'
    },
    search: true,
    rules: [{
      required: true,
      message: '请选择票种',
      trigger: 'blur'
    }]
  }, {
    label: '计划数量',
    prop: 'planNumber',
    rules: [{
      required: true,
      message: '请输入计划数量',
      trigger: 'blur'
    }],
    type: 'number',
    precision: 0
  }, {
    label: '单位',
    prop: 'planUnit',
    dicUrl: '/admin/dict/type/ticket_amount',
    rules: [{
      required: true,
      message: '请输入单位',
      trigger: 'blur'
    }]
  }, {
    label: '作业时间',
    prop: 'planYear',
    type: 'year',
    format: 'yyyy',
    valueFormat: 'yyyy',
    search: 'true',
    searchValue: nowYear, 
    rules: [{
      required: true,
      message: '请选择作业时间',
      trigger: 'blur'
    }]
  }, {
    label: '工作地点',
    prop: 'workPlace',
    rules: [{
      required: true,
      message: '请输入工作地点',
      trigger: 'blur'
    }]
  },{
    label: '运营商',
    prop: 'operator',
    search: true
  }, {
    label: '审批状态',
    prop: 'checkStatus',
    type: 'select',
    dicUrl: '/admin/dict/type/check_status',
    search: 'true',
    rules: [{
      required: true,
      message: '请选择审批状态',
      trigger: 'blur'
    }],
    addDisplay: false,
    editDisplay: false
  }, {
    label: '审核时间',
    prop: 'checkTime',
    addDisplay: false,
    editDisplay: false
  }, {
    label: '备注',
    prop: 'remark',
    span: 24,
    type: 'textarea',
    maxRows: 6,
    minRows: 4
  }]
};

export const formOptionAdd = {
  menuBtn: false,
  emptyBtn: false,
  submitBtn: false,
  arrow: false,
  column: [{
    label: '标识',
    prop: 'id',
    display: false,
  }, {
    label: '计划类型',
    prop: 'planType',
    type: 'select',
    dicUrl: '/admin/dict/type/plan_type',
    search: true,
    rules: [{
      required: true,
      message: '请选择计划类型',
      trigger: 'blur'
    }]
  }, {
    label: '票种',
    prop: 'ticketType',
    type: 'select',
    dicUrl: '/support/swpmticketcardtype/dict',
    props: {
      label: 'mainName',
      value: 'mainEnName'
    },
    rules: [{
      required: true,
      message: '请选择票种',
      trigger: 'blur'
    }]
  }, {
    label: '计划数量',
    prop: 'planNumber',
    rules: [{
      required: true,
      message: '请输入计划数量',
      trigger: 'blur'
    }],
    type: 'number',
    precision: 0,
    disabled: true
  }, {
    label: '单位',
    prop: 'planUnit',
    type: 'select',
    dicUrl: '/admin/dict/type/ticket_amount',
    rules: [{
      required: true,
      message: '请输入单位',
      trigger: 'blur'
    }]
  }, {
    label: '作业时间',
    prop: 'planYear',
    type: 'year',
	format: 'yyyy',
	valueFormat: 'yyyy',
    rules: [{
      required: true,
      message: '请选择作业时间',
      trigger: 'blur'
    }]
  }, {
    label: '工作地点',
    prop: 'workPlace',
    rules: [{
      required: true,
      message: '请输入工作地点',
      trigger: 'blur'
    }]
  },{
    label: '运营商',
    prop: 'operator'
  }, {
    label: '审核状态',
    prop: 'checkStatus',
    type: 'select',
    dicUrl: '/admin/dict/type/check_status',
    rules: [{
      required: true,
      message: '请选择审核状态',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '审核时间',
    prop: 'checkTime',
    display: false,
  }, {
    label: '备注',
    prop: 'remark',
    span: 24,
    type: 'textarea',
    maxRows: 6,
    minRows: 4,
  }]
};

export const formOptionView = {
  menuBtn: false,
  emptyBtn: false,
  submitBtn: false,
  detail: true,
  arrow: false,
  column: [{
    label: '标识',
    prop: 'id',
    display: false,
  }, {
    label: '工作类型',
    prop: 'planType',
    type: 'select',
    dicUrl: '/admin/dict/type/plan_type',
    search: true,
    rules: [{
      required: true,
      message: '请选择工作类型',
      trigger: 'blur'
    }]
  }, {
    label: '票种',
    prop: 'ticketType',
    type: 'select',
    dicUrl: '/support/swpmticketcardtype/dict',
    props: {
      label: 'mainName',
      value: 'mainEnName'
    },
    rules: [{
      required: true,
      message: '请选择票种',
      trigger: 'blur'
    }]
  }, {
    label: '计划数量',
    prop: 'planNumber',
    rules: [{
      required: true,
      message: '请输入计划数量',
      trigger: 'blur'
    }],
    type: 'number',
    precision: 0
  }, {
    label: '单位',
    prop: 'planUnit',
    type: 'select',
    dicUrl: '/admin/dict/type/ticket_amount',
    rules: [{
      required: true,
      message: '请输入单位',
      trigger: 'blur'
    }]
  }, {
    label: '作业时间',
    prop: 'planYear',
    type: 'year',
	format: 'yyyy',
	valueFormat: 'yyyy',
    rules: [{
      required: true,
      message: '请选择作业时间',
      trigger: 'blur'
    }]
  }, {
    label: '工作地点',
    prop: 'workPlace',
    rules: [{
      required: true,
      message: '请输入工作地点',
      trigger: 'blur'
    }]
  },{
    label: '运营商',
    prop: 'operator'
  }, {
    label: '审批状态',
    prop: 'checkStatus',
    type: 'select',
    dicUrl: '/admin/dict/type/check_status',
    rules: [{
      required: true,
      message: '请选择审批状态',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '审核时间',
    prop: 'checkTime',
    display: false,
  }, {
    label: '备注',
    prop: 'remark',
    span: 24,
    type: 'textarea',
    maxRows: 6,
    minRows: 4,
  }]
};

export const formOptionCheckInfo = {
  menuBtn: false,
  detail: true,
  column: [{
    label: '审批状态',
    prop: 'checkStatus',
    type: 'select',
    dicUrl: '/admin/dict/type/check_status',
  }, {
    label: '审核建议',
    prop: 'checkSuggest',
    type: 'textarea',
    span: 24
  }]
}

export const planOptionAdd = {
  column: [{
    label: '周期',
    prop: 'cycle',
    type: 'select',
    dicData: [{
      label: '1个月',
      value: '1'
    }, {
      label: '3个月',
      value: '3'
    }, {
      label: '4个月',
      value: '4'
    }, {
      label: '6个月',
      value: '6'
    }, ],
    clearable: false,
    cell: true,
  }, {
    label: '1月',
    prop: '1',
    type: 'number',
    cell: true,
  }, {
    label: '2月',
    prop: '2',
    type: 'number',
    cell: true,
  }, {
    label: '3月',
    prop: '3',
    type: 'number',
    cell: true,
  }, {
    label: '4月',
    prop: '4',
    type: 'number',
    cell: true,
  }, {
    label: '5月',
    prop: '5',
    type: 'number',
    cell: true,
  }, {
    label: '6月',
    prop: '6',
    type: 'number',
    cell: true,
  }, {
    label: '7月',
    prop: '7',
    type: 'number',
    cell: true,
  }, {
    label: '8月',
    prop: '8',
    type: 'number',
    cell: true,
  }, {
    label: '9月',
    prop: '9',
    type: 'number',
    cell: true,
  }, {
    label: '10月',
    prop: '10',
    type: 'number',
    cell: true,
  }, {
    label: '11月',
    prop: '11',
    type: 'number',
    cell: true,
  }, {
    label: '12月',
    prop: '12',
    type: 'number',
    cell: true,
  }, ]
};
